

import 'package:flutter/material.dart';
import 'package:get/get.dart';

class myshowBottomSheet extends StatelessWidget{
  double height;
  Widget body;
  Widget bottomnavigationBar;
  Widget flexibleSpace;

  myshowBottomSheet(
      this.height, this.body, this.bottomnavigationBar, this.flexibleSpace);

  Future showBottomSheets(BuildContext context) {

    return showModalBottomSheet(
      //设置为自定义高度
        isScrollControlled: true,
        //设置圆角
        shape: RoundedRectangleBorder(
            borderRadius: BorderRadius.only(
                topLeft: Radius.circular(20),
                topRight: Radius.circular(20))),
        context: context,
        builder: (context){
          return SizedBox(
            height: height,
            child: Scaffold(
              appBar: PreferredSize(

                preferredSize: Size.fromHeight(110),
                child: AppBar(
                  //去掉前面的返回键
                    backgroundColor: Colors.transparent,
                    elevation: 0,
                    automaticallyImplyLeading: false,
                    flexibleSpace: flexibleSpace
                ),
              ),
              body:  body,
              bottomNavigationBar: bottomnavigationBar,
            ),
          );
        }
    );
  }

  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    throw UnimplementedError();
  }
}
